#include "Server.hpp"
#include "Log.hpp"
#include "Daemon.hpp"

int main(int argc,char* argv[])
{
    if(argc != 2)
    {
        LOG(ERROR,"./tcpserver serverport\n");
        exit(2);
    }
    //Daemon(false,false);
    
    uint16_t localport = std::stoi(argv[1]);
    
    std::unique_ptr<TcpServer> server = std::make_unique<TcpServer>(localport);
    server->Init();
    server->Loop();

    return 0;
}